package fivestar.ui.main;

import java.awt.Color;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import org.jdesktop.swingx.JXBusyLabel;
import java.awt.Font;
 
public class SplashScreen extends javax.swing.JDialog {

	private static final long serialVersionUID = 1674114776617466100L;
	JXBusyLabel lblLoading;
	JLabel jLabel1;
	
    public SplashScreen(java.awt.Frame parent, boolean modal) {
        super(parent,modal);
        initComponents();
        setLocationRelativeTo(null);
    } 
	
	private void initComponents() {
		try {			 
			
			getContentPane().setLayout(null);
			
			lblLoading = new JXBusyLabel();
			lblLoading.setFont(new Font("Tahoma", Font.BOLD, 11));
			lblLoading.setForeground(Color.WHITE);
			lblLoading.setText("Loading...");
			lblLoading.setBusy(true);
			lblLoading.setBounds(70, 196, 116, 26);
			getContentPane().add(lblLoading);

			jLabel1 = new JLabel();
			jLabel1.setBounds(0, 0, 500, 375); 
			getContentPane().add(jLabel1);
			jLabel1.setIcon(new ImageIcon(getClass().getClassLoader().getResource("fivestar/ui/main/images/Splash.png"))); 

			this.setSize(515, 410);
			
		} catch (Exception ex) {
			System.out.println("Error SplashScreen :"+ ex.getMessage());
			ex.printStackTrace();
		}
	}
	
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
            	SplashScreen dialog = new SplashScreen(null,true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

}
